package cn.iocoder.yudao.module.system.enums.pay;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum TenantProductTypeEnum {

    AGENT(1, "坐席"),
    PHONE_BILL(2, "话费"),
    AI_AGENT(3, "AI坐席"),
    AI_BILL(4, "AI话费"),
    ACCOUNT(5, "员工账号"),
    ;

    /**
     * 类型
     */
    private final Integer id;
    /**
     * 名字
     */
    private final String name;


    public static String getName(int id) {
        TenantProductTypeEnum tenantProductTypeEnum = Arrays.stream(values()).filter(i -> i.id == id).findFirst().get();
        return tenantProductTypeEnum.getName();
    }

    public static TenantProductTypeEnum getById(int id) {
        return ArrayUtil.firstMatch(o -> o.getId().equals(id), values());
    }

}
